package com.service.pay.diamond.mapper;

import com.service.pay.diamond.dto.request.UnifiedOrderDto;
import com.service.pay.diamond.dto.response.PrepareOrderDto;
import com.service.pay.diamond.model.UnifiedOrderModel;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UnifiedOrderMapper {
    @Autowired
    private ModelMapper mapper;

    public PrepareOrderDto modelToDto(UnifiedOrderModel model) {
        return mapper.map(model, PrepareOrderDto.class);
    }

    public UnifiedOrderModel dtoToModel(UnifiedOrderDto dto) {
        return mapper.map(dto, UnifiedOrderModel.class);
    }
}
